package com.substation.ui.utils;

import android.content.Context;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;

import com.substation.ui.weight.FullyLinearLayoutManager;


/**
 * Created by admin on 2017/12/8.
 */

public class RecyclerViewUtils {
    /**
     * 水平方向一列展示
     * @param context
     */
    public static LinearLayoutManager getLinearLayoutManagerForHorizontal(Context context){
        LinearLayoutManager linearLayoutManager=new LinearLayoutManager(context);
        linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
        return linearLayoutManager;
    }

    public static LinearLayoutManager getLinearLayoutManagerForVertical(Context context){
        LinearLayoutManager linearLayoutManager=new LinearLayoutManager(context);
        linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        return linearLayoutManager;
    }

    public static GridLayoutManager getGridLayoutManager(Context context, int grideNum){
        GridLayoutManager layoutManage = new GridLayoutManager(context, grideNum);
        return layoutManage;
    }

    public static FullyLinearLayoutManager getFullyLinearLayoutManagerForHorizontal(Context context){
        FullyLinearLayoutManager fullyLinearLayoutManager=new FullyLinearLayoutManager(context);
        fullyLinearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
        return fullyLinearLayoutManager;
    }
    public static FullyLinearLayoutManager getFullyLinearLayoutManagerForVertical(Context context){
        FullyLinearLayoutManager fullyLinearLayoutManager=new FullyLinearLayoutManager(context);
        fullyLinearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        return fullyLinearLayoutManager;
    }
}
